<div id="{{op.operationId}}" class="heading">
    <a ng-click="op.open=!op.open;op.open?permalink(op.operationId):''">
        <div class="clearfix">
            <span class="http-method text-uppercase" ng-bind="op.httpMethod"></span>
            <span class="path" ng-class="{deprecated:op.deprecated}" ng-bind="op.path"></span>
            <span class="description pull-right" ng-bind="op.summary"></span>
        </div>
    </a>
</div>
<div class="content" ng-if="op.open">
    <div class="h5" ng-if="op.deprecated" swagger-translate="operationDeprected"></div>
	<div ng-if="op.description">
		<h5 swagger-translate="operationImplementationNotes"></h5>
		<p ng-bind-html="op.description"></p>
    </div>
    <div ng-if="op.externalDocs">
        <h5 swagger-translate="externalDocs"></h5>
        <span ng-bind-html="op.externalDocs.description"></span>
        <a target="_blank" ng-href="{{op.externalDocs.url}}" ng-bind="op.externalDocs.url"></span></a>
    </div>
    <button ng-if="op.security.length>0" ng-click="auth(op)" class="auth-required" ng-class="{valid:authValid(op)}" title="{{'authRequired'|swaggerTranslate}}">!</button>
    <form role="form" name="explorerForm" ng-submit="explorerForm.$valid&&submitExplorer(op)">
    	<div ng-if="op.responseClass" class="response">
    		<h5 swagger-translate="responseClass" swagger-translate-value="op.responseClass"></h5>
    		<div ng-if="op.responseClass.display!=-1">
        		<ul class="list-inline schema">
        			<li><a ng-click="op.responseClass.display=0" ng-class="{active:op.responseClass.display==0}" swagger-translate="responseModel"></a></li>
        			<li><a ng-click="op.responseClass.display=1" ng-class="{active:op.responseClass.display==1}" swagger-translate="responseSchema"></a></li>
        		</ul>
        		<pre class="model" ng-if="op.responseClass.display==0" ng-bind-html="getModel(op.responseClass,op.operationId,'default')"></pre>
        		<pre select-on-db-click class="model-schema" ng-if="op.responseClass.display==1" ng-bind="getSample(op.responseClass,ui.form[op.id].responseType)"></pre>
    		</div>
    	</div>
        <div ng-if="op.headers" class="table-responsive">
            <h5 swagger-translate="headers"></h5>
            <table class="table table-condensed headers">
                <thead>
                    <tr>
                        <th class="name" swagger-translate="headerName"></th>
                        <th class="desc" swagger-translate="headerDescription"></th>
                        <th class="type" swagger-translate="headerType"></th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="(name,header) in op.headers track by $index" ng-class="header.css" class="response-header">
                        <td class="bold" ng-bind="name"></td>
                        <td ng-bind-html="header.description"></td>
                        <td ng-bind="header.type"></td>
                    </tr>
                </tbody>
            </table>
        </div>
    	<div ng-if="op.parameters&&op.parameters.length>0" class="table-responsive">
    		<h5 swagger-translate="parameters"></h5>
    		<table class="table table-condensed parameters">
    			<thead>
    				<tr>
    					<th class="name" swagger-translate="parameterName"></th>
    					<th class="value" swagger-translate="parameterValue"></th>
    					<th class="desc" swagger-translate="parameterDescription"></th>
    					<th class="type" swagger-translate="parameterType"></th>
    					<th class="data" swagger-translate="parameterDataType"></th>
    				</tr>
    			</thead>
    			<tbody>
    				<tr ng-repeat="param in op.parameters track by $index" ng-include="'templates/parameter.html'" class="operation-parameter" ng-class="[param.css,'operation-parameter-'+param.in]"></tr>
    			</tbody>
    		</table>
		</div>
        <div ng-if="op.produces" class="content-type">
            <label for="responseContentType{{op.id}}" swagger-translate="responseContentType"></label>
            <select ng-model="ui.form[op.id].responseType" ng-options="item for item in op.produces track by item" id="responseContentType{{op.id}}" name="responseContentType{{op.id}}" required></select>
        </div>
    	<div class="table-responsive" ng-if="op.hasResponses">
    		<h5 swagger-translate="responses"></h5>
    		<table class="table responses">
    			<thead>
    				<tr>
    					<th class="code" swagger-translate="responseCode"></th>
    					<th swagger-translate="responseReason"></th>
    					<th swagger-translate="responseModel"></th>
    				</tr>
    			</thead>
    			<tbody>
    				<tr ng-repeat="(code,resp) in op.responses track by $index" ng-include="'templates/response.html'" class="operation-response" ng-class="resp.css"></tr>
    			</tbody>
    		</table>
    	</div>
    	<div ng-if="apiExplorer">
    		<button class="btn btn-default" ng-click="op.explorerResult=false;op.hideExplorerResult=false" type="submit" ng-disabled="op.loading" ng-bind="op.loading?'explorerLoading':'explorerTryIt'|swaggerTranslate"></button>
        	<a class="hide-try-it" ng-if="op.explorerResult&&!op.hideExplorerResult" ng-click="op.hideExplorerResult=true" swagger-translate="responseHide"></a>
    	</div>
	</form>
	<div ng-if="op.explorerResult" ng-show="!op.hideExplorerResult" class="explorer-result">
		<h5 swagger-translate="explorerUrl"></h5>
		<pre select-on-db-click ng-bind="op.explorerResult.url" class="explorer-url"></pre>
		<h5 swagger-translate="explorerBody"></h5>
		<pre select-on-db-click ng-bind="op.explorerResult.response.body" class="explorer-body"></pre>
		<h5 swagger-translate="explorerCode"></h5>
		<pre select-on-db-click ng-bind="op.explorerResult.response.status" class="explorer-status"></pre>
		<h5 swagger-translate="explorerHeaders"></h5>
		<pre select-on-db-click ng-bind="op.explorerResult.response.headers" class="explorer-headers"></pre>
	</div>
</div>